import request from '@/utils/request'

// 查询权限列表
export const getPermissionListApi = () => {
  return request({
    url: '/sys/permission',
    method: 'get'
  })
}
// 查询单个权限
export const getPermissionInfoApi = (id) => {
  return request({
    url: '/sys/permission/' + id,
    method: 'get'
  })
}

// 添加权限
export const addPermissionApi = (data) => {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 修改权限
export const editPermissionApi = (data) => {
  return request({
    url: '/sys/permission/' + data.id,
    method: 'put',
    data
  })
}

// 删除权限
export const delPermissionApi = (id) => {
  return request({
    url: '/sys/permission/' + id,
    method: 'delete'
  })
}
